<form nz-form [formGroup]="validateForm">

	<nz-form-item>
		<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="oldPsd">旧密码</nz-form-label>
		<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="旧密码不能为空!">
			<input [type]="isShowPassword ? 'text' : 'password'" nz-input formControlName="oldPsd" placeholder="请输入密码" />
		</nz-form-control>
	</nz-form-item>



	<nz-form-item>
		<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="newPsd">
			新密码
		</nz-form-label>
		<nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="passwordErrorTpl">
			<input nz-input type="{{isShowPassword ? 'text' : 'password'}}" placeholder="请输入新密码"
				(ngModelChange)="updateConfirmValidator()" formControlName="newPsd" id="newPsd">
			<ng-template #passwordErrorTpl>
				<ng-container *ngIf="getFormControl('newPsd').hasError('required')">
					新密码不能为空
				</ng-container>
				<ng-container *ngIf="getFormControl('newPsd').hasError('strength')">
					密码必须满足强度要求，长度不少于8位，且使用以下四种类型字符并同时包含三种以上：特殊符号、数字、小写字母，大写字母
				</ng-container>
			</ng-template>
			<!-- <nz-form-explain *ngIf="validateForm.get('newPsd').dirty && validateForm.get('newPsd').errors">新密码不能为空！</nz-form-explain> -->
		</nz-form-control>
	</nz-form-item>
	<nz-form-item>
		<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="checkPsd">
			确认密码
		</nz-form-label>
		<nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="checkPasswordErrorTpl">
			<input nz-input type="{{isShowPassword ? 'text' : 'password'}}" placeholder="请再次输入新密码"
				formControlName="checkPsd" id="checkPsd">
			<ng-template #checkPasswordErrorTpl>
				<ng-container *ngIf="getFormControl('checkPsd').hasError('required')">
					确认密码不能为空
				</ng-container>
				<ng-container *ngIf="getFormControl('checkPsd').hasError('confirm')">
					两次新密码输入不一致！
				</ng-container>
			</ng-template>
		</nz-form-control>
	</nz-form-item>
	<nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="isShowPassword">
            显示密码
        </nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <nz-switch formControlName="isShowPassword" nzCheckedChildren="是" nzUnCheckedChildren="否"></nz-switch>
        </nz-form-control>
    </nz-form-item>
</form>
<div class="modal-footer">
	<button style="margin-right: 20px;" nz-button (click)="handleCancel()">取消</button>
	<button nz-button (click)="onSubmit()"
		[nzLoading]="isLoading" [nzType]="'primary'">确定</button>
</div>